//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Workflow.ComponentModel;
using System.Collections;
using System.Collections.Specialized;
using System.Workflow.ComponentModel.Design;
using System.ComponentModel.Design;
using System.Workflow.ComponentModel.Compiler;
using Microsoft.Research.ScientificWorkflow;
using System.Workflow.Activities;

namespace Microsoft.Research.ScientificWorkflow.Activities
{
    [Name("For Each Loop Activitiy for looping through a list", "For-Each Branch")]
    [Description("Iterates over child activities for each item in the member list.")]
    [WorkflowCategory("Control Flow")]
    [HideActivity(true)]
    public class ForEachBranch : SequenceActivity
    {
        public static DependencyProperty DataItemProperty =
            System.Workflow.ComponentModel.DependencyProperty.Register("DataItem", typeof(object), typeof(ForEachBranch));

        [RequiredInputParam]
        [Name("Current Item")]
        [Description("The current item in the list of the For Each acitivity")]
        public object DataItem
        {
            get
            {
                return ((object)(base.GetValue(ForEachBranch.DataItemProperty)));
            }
            set
            {
                base.SetValue(ForEachBranch.DataItemProperty, value);
            }
        }

        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            return base.Execute(executionContext);
        }
    }
}
